package com.zkq.graduate.conf;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author zhangkaiqiang
 * @Date 2019/12/14  23:15
 * @Description TODO
 */
@Configuration
public class PageOfficeConfig {


	@Value("${pageoffice.posyspath}")
	private String poSysPath;

	/**
	 *
	 * @return
	 */
	@Bean
	public ServletRegistrationBean servletRegistrationBean() {
		com.zhuozhengsoft.pageoffice.poserver.Server poserver = new com.zhuozhengsoft.pageoffice.poserver.Server();

		// 设置PageOffice注册成功后,license.lic文件存放的目录
		poserver.setSysPath(poSysPath);
		ServletRegistrationBean srb = new ServletRegistrationBean(poserver);
		srb.addUrlMappings("/poserver.zz");
		srb.addUrlMappings("/posetup.exe");
		srb.addUrlMappings("/pageoffice.js");
		srb.addUrlMappings("/jquery.min.js");
		srb.addUrlMappings("/pobstyle.css");
		srb.addUrlMappings("/sealsetup.exe");
		return srb;
	}
}
